package round84;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * User: Samuel
 * Date: 08-29-11
 * Time: 10:52 AM
 */
public class C {
    public static void main(String[] args) throws IOException {
        final int MAXVAL = 1000000;
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(in.readLine());
        int minX = MAXVAL, minY = MAXVAL;
        for (int x = 0; x * 4 <= n; x++) {
            int y = (n - x * 4) / 7;
            if (((x * 4 + y * 7) == n) && (((x + y) < (minX + minY)) || (((x + y) == (minX + minY)) && x > minX))) {
                minX = x;
                minY = y;
            }
        }
        
        if (minX == MAXVAL && minY == MAXVAL) {
            System.out.println(-1);
        } else {
            StringBuilder sb = new StringBuilder(minX + minY);
            for (int i = 0; i < minX; i++) {
                sb.append('4');
            }
            for (int i = 0; i < minY; i++) {
                sb.append('7');
            }
            System.out.println(sb.toString());
        }
    }
}
